/* 
 * Copyright (c) 2019, CENTRIN.CIYUN.LTD. All rights reserved.
 */
package com.cory.admin.sys.domain;

import lombok.Data;
import lombok.EqualsAndHashCode;
import com.cory.admin.sys.domain.entity.SysUser;
import com.cory.boot.domain.bean.Principal;

/**
 * 存放在session中的用户信息
 * @author xiongcong
 * @date 2019-02-26
 */
@Data
@EqualsAndHashCode(callSuper=true)
public class AdminPrincipal extends Principal {
    private static final long serialVersionUID = 1L;
    
    private String token;
    private String loginName;
    private Integer userType;
    private Integer targetId;
    private Integer superFlag;
    
    public AdminPrincipal(String token, SysUser user) {
        super();
        this.token = token;
        this.loginName = user.getLoginName();
        this.userId = user.getId();
        this.userType = user.getUserType();
        this.tenantId = user.getTenantId();
        this.targetId = user.getTargetId();
        this.superFlag = user.getSuperFlag();
    }
    
    private Integer loginId;
}
